import type { Package } from './package'
import type { Photographer } from './photographer'

export interface Booking {
  id: number
  booking_number: string // 预约单号
  customer_name: string
  customer_phone: string
  customer_email: string
  wedding_date: string
  photographer: Photographer
  package: Package
  deposit_amount: number // 定金金额
  total_amount: number // 总金额
  shooting_date: string // 预约拍摄时间
  status: number
  remark?: string
  created_at: string
  cancel_reason?: string
}

export type ShootingType =
  | 'wedding' // 婚纱摄影
  | 'portrait' // 写真
  | 'children' // 儿童摄影
  | 'family' // 全家福
  | 'maternity' // 孕妇照

export const specialtiesMap: Record<string, string> = {
  wedding: '婚纱摄影',
  portrait: '写真',
  children: '儿童摄影',
  family: '全家照',
  maternity: '孕妇照',
}

// 获取拍摄类型标签类型
export const getShootingTypeTagType = (type: ShootingType) => {
  const types: Record<ShootingType, string> = {
    wedding: 'danger',
    portrait: 'warning',
    children: 'success',
    family: 'info',
    maternity: 'primary',
  }
  return types[type]
}

// 获取拍摄类型标签文本
export const getShootingTypeLabel = (type: ShootingType) => {
  const labels: Record<ShootingType, string> = {
    wedding: '婚纱摄影',
    portrait: '写真',
    children: '儿童摄影',
    family: '全家福',
    maternity: '孕妇照',
  }
  return labels[type]
}

export type BookingStatus =
  | 'pending' // 待确认
  | 'confirmed' // 已确认
  | 'completed' // 已完成
  | 'cancelled' // 已取消

export interface BookingQuery {
  keyword?: string
  status?: number
  startTime?: string
  endTime?: string
  photographerId?: number
}
